package com.example.justbuy.service.Impl;

import com.example.justbuy.mapper.StoreDao;
import com.example.justbuy.pojo.*;
import com.example.justbuy.service.StoreDaoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class StoreDaoServiceImpl implements StoreDaoService {
    @Autowired
    private StoreDao storeDao;

    @Override
    public int insertStore(HashMap map) {
        return storeDao.insertStore(map);
    }

    @Override
    public List<Store> getAllStoreBybusinessNum(String businessNum) {
        return storeDao.getAllStoreBybusinessNum(businessNum);
    }

    @Override
    public List<Store> getAllStoreById(int id) {
        return storeDao.getAllStoreById(id);
    }

    @Override
    public List<Order> getAllOrderById(int id) {
        return storeDao.getAllOrderById(id);
    }

    @Override
    public List<Store> getBankById(int id) {
        return storeDao.getBankById(id);
    }

    @Override
    public int updateBankcode(HashMap map) {
        return storeDao.updateBankcode(map);
    }

    @Override
    public int updateUser(HashMap map) {
        return storeDao.updateUser(map);
    }

    @Override
    public int getStoreIdBybusinessNum(String businessNum) {
        return storeDao.getStoreIdBybusinessNum(businessNum) ;
    }

    @Override
    public User getAlluser(int id) {
        return storeDao.getAlluser(id);
    }

    @Override
    public List<Goods> getAllGoodsByStoreId(int storeid) {
        return storeDao.getAllGoodsByStoreId(storeid);
    }

    @Override
    public int addGoods(HashMap map) {
        return storeDao.addGoods( map);
    }

    @Override
    public List<Order> getGoodsOrderByStoreId(int storeid) {
        return storeDao.getGoodsOrderByStoreId(storeid);
    }

    @Override
    public List<Order> getGoodsOrderByorderState(HashMap map) {
        return storeDao.getGoodsOrderByorderState(map);
    }

    @Override
    public List<Order> getUserid(String orderid) {
        return storeDao.getUserid(orderid);
    }

    @Override
    public List<User> getUserByUserId(int userid) {
        return storeDao.getUserByUserId(userid);
    }

    @Override
    public List<Address> getAddressByaddress(String address) {
        return storeDao.getAddressByaddress(address);
    }


    @Override
    public int   updateStore(Map<String, Object> map){return storeDao.updateStore(map);};

    @Override
    public Double getAllPriceByStoreId(int storeid) {
        return storeDao.getAllPriceByStoreId(storeid);
    }

    @Override
    public List<Order> getAll0rderBypay(HashMap map) {
        return storeDao.getAll0rderBypay(map);
    }

    @Override
    public Goods getBygoodsCode(String goodsCode) {
        return storeDao.getBygoodsCode(goodsCode);
    }
}
